<include file="Public:header" />
<link href="__PUBLIC__/Catalog/css/collect.css" rel="stylesheet" type="text/css" />
</head>
<body>

<div class="main">
   <div class="title">
         <div class="title1">
             <a href="{:U('Membership/index')}" id="back"> < </a>我的收藏
         </div>
   </div>
   <div class="historyList">
        <ul>
           <foreach name="collectlist" item="vo">
           <li id="del{$vo.products_id}">
               <table>
                   <tr>
                       <td><img src="__PUBLIC__/images/products/{$vo.products_image}" width="73" height="63" /></td>
                       <td style="width:280px;">
                          <dl>
                             <dd id="li1">
	                             <span class="spanx1"><a href="{:U('Products/detail')}?pid={$vo.products_id}">{$vo.products_name}</a></span>
	                             <span class="spanx2"  onclick="javascript:delcollect('del{$vo.products_id}','{$vo.products_id}')"></span>
                             </dd>
                             <dd id="li2"><span class="span1">
                              <a  class="span1" href="{:U('Products/index')}?cid={$vo.cate.categories_id}">{$vo.cate.categories_name}</a>
                            
                            </span><span class="span2">{$vo.products_date_added}</span></dd>
                          </dl>
                       </td>
                   </tr>
               </table>
           </li>
           </foreach>
        </ul>
   </div>
</div>
<script>
function delcollect(obj,pid){
	$.ajax({
		type:"post",
		url:"{:U('Membership/delcollect')}",
		datatype:'json',
		data:{pid:pid},
		success:function(result){
			datacontent =window.JSON.parse(result);
				alert(datacontent.msg);
				$('#'+obj).remove();
		},
		error: function(XMLHttpRequest, textStatus, errorThrown) {
			alert(XMLHttpRequest.status);
			alert(XMLHttpRequest.readyState);
			alert(textStatus);
		},
	});
}
</script>
<include file="Public:footer" />
